package com.topwalk.step01;

import lombok.extern.slf4j.Slf4j;

/**
 * 实现Runnable实现多线程
 * 
 * @author tang
 */
@Slf4j
public class Demo2_2Runnable {
    
    public static class MyThread implements Runnable {
        @Override
        public void run() {
            log.debug("implements runnable");
        }
    }

    public static void main(String[] args) {

        new Thread(new MyThread()).start();

        // Java 8 函数式编程，可以省略MyThread类
        new Thread(() -> log.debug("Java 8 匿名内部类")).start();
    }
    
}